#include<iostream>
#include<cstring>
using namespace std;

class Phone
{
private:
    string phone;
    string status_;
    char *name;
    char type;
    int status;
public:
    Phone(string _phone,char _type,int _status,char *_name)
    {
        phone=_phone;
        type=_type;
        status=_status;
        name=new char[strlen(_name+1)];
        strcpy(name,_name);
        cout<<phone<<" "<<"constructed."<<endl;
    }
    void print()
    {
        cout<<"Phone="<<phone<<"--Type="<<type;
        if (state)
            cout << "--State=use--Owner=";
        else
            cout << "--State=unuse--Owner=";
        cout<<name<<endl;
    }
};

int main()
{
    string phone[3];
    Phone *p[3];
    char name[21];
    int status;
    char type;
    cin>>phone[0]>>type>>status>>name;
    p[0]->Phone(phone[0],type,status,name);
    cin>>phone[1]>>type>>status>>name;
    p[1]=Phone(phone[1],type,status,name);
    cin>>phone[2]>>type>>status>>name;
    p[2]=Phone(phone[2],type,status,name);
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        string phone_;
        int cnt=0;
        cin>>phone_;
        for(int j=0;j<3;j++)
        {
            if(phone[j]==phone_)
            {
                cnt++;
                
            }
        }
    }
    return 0;
}